import request from '@/utils/request';

/**
 * 查询门店列表
 *
 * @param {object} query
 */
export const listStore = (query:object) => {
	return request({
		url: '/manage/store/list',
		method: 'get',
		params: query
	});
};
/**
 * 查询简单的门店列表
 *
 * @param {object} query
 */
export const easyListStore = (query:object) => {
	return request({
		url: '/manage/store/listAll',
		method: 'get',
		params: query
	});
};
/**
 * 查询门店列表
 *
 * @param {object} query
 */
export const listStorePage = (query:object) => {
	return request({
		url: '/manage/store/page',
		method: 'get',
		params: query
	});
};

/**
 * 查询门店详细
 *
 * @param {string} storeId
 */
export const getStore = (storeId:string) => {
	return request({
		url: '/manage/store/' + storeId,
		method: 'get'
	});
};

/**
 * 新增门店
 *
 * @param {object} data
 */
export const addStore = (data:object) => {
	return request({
		url: '/manage/store/add',
		method: 'post',
		data: data
	});
};

/**
 *  修改门店
 *
 * @param {object} data
 */
export const updateStore = (data:object) => {
	return request({
		url: '/manage/store/edit',
		method: 'put',
		data: data
	});
};

/**
 * 删除门店
 *
 * @param {string} storeId
 */
export const delStore = (storeId:string) => {
	return request({
		url: '/manage/store/' + storeId,
		method: 'delete'
	});
};

/**
 * 导出门店
 *
 * @param {object} query
 */
export const exportStore = (query:object) => {
	return request({
		url: '/manage/store/export',
		method: 'get',
		params: query
	});
};
/**
 * 获取门店在线数量和离线数量
 *
 * @param {object} query
 */
export const storeCount = () => {
	return request({
		url: '/manage/store/selectPrinterCount',
		method: 'post',
	});
};

// /**
//  * 导出门店(返回流)
//  *
//  * @param {object} query
//  */
// export const exportStore = (query:object) => {
// 	return request({
// 		url: '/manage/store/exportByStream',
// 		method: 'post',
// 		data: query
// 	});
// };
